<template>
	<view>
		<navigator url="/pages/scoreshop/order/my">
			<xy-tag type="warning">兑换记录</xy-tag>
		</navigator>
		<view class="item-list-section">
			<navigator
				:url="'/pages/scoreshop/item/info?id=' + item.id"
				v-for="(item, index) in dataList" :key="index"
				class="guess-item">
				<view class="image-wrapper">
					<xy-image :src="item.cover" mode="aspectFill"></xy-image>
				</view>
				<text class="title clamp">{{item.title}}</text>
				<text class="price">{{item.price}}积分</text>
			</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: []
			};
		},
		onLoad() {
			this.loadData();
		},
		methods: {
			async loadData() {
				uni.showLoading({
					tilte: '加载中...'
				});
				let res = await this.util.request({
					url: '/v1/scoreshop/item/lists',
					method: 'get'
				});
				if (res.code == 200) {
					this.dataList = res.data.dataList;
				} else {
					this.util.showToast({
						title: res.msg,
						icon: 'loading',
						duration: 2000
					});
				}
				uni.hideLoading();
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
